<template>
    <el-dialog v-model="dialogFormVisible" :title="title" @close="closeDialog">
        <el-form :model="addAchievementForm" ref="addAchievementRef" :rules="addAchievementrules" :inline="true">
                  
                        <!-- <el-form-item label="学年" :label-width="formLabelWidth"
                                      prop="schoolYear">
                            <el-input
                                    v-model="addAchievementForm.schoolYear"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写学年"
                            ></el-input>
                        </el-form-item> -->
                   
                        <el-form-item label="班级名称" :label-width="formLabelWidth"
                                      prop="clsName">
                            <el-input disabled
                                    v-model="addAchievementForm.clsName"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写班级名称"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="考试名称" :label-width="formLabelWidth"
                                      prop="typeName">
                            <el-input disabled
                                    v-model="addAchievementForm.typeName"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写考试名称"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="学生姓名" :label-width="formLabelWidth"
                                      prop="studentName">
                            <el-input
                                    v-model="addAchievementForm.studentName"
                                    autocomplete="off" disabled
                                    ref="name"
                                    placeholder="请填写学生姓名"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="学生学号" :label-width="formLabelWidth"
                                      prop="studentNumber">
                            <el-input
                                    v-model="addAchievementForm.studentNumber"
                                    autocomplete="off" disabled 
                                    ref="name"
                                    placeholder="请填写学生学号"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="语文" :label-width="formLabelWidth"
                                      prop="chinese" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.chinese"
                                    autocomplete="off"
                                    ref="name"
                                    type="number"
                                    placeholder="请填写语文分数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="数学" :label-width="formLabelWidth"
                                      prop="mathematics" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.mathematics"
                                    autocomplete="off"
                                    ref="name"
                                    type="number"

                                    placeholder="请填写数学分数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="英语" :label-width="formLabelWidth"
                                      prop="english" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.english"
                                    autocomplete="off"
                                    ref="name"
                                    type="number"

                                    placeholder="请填写英语分数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="物理" :label-width="formLabelWidth"
                                      prop="physics" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.physics"
                                    autocomplete="off"
                                    ref="name"
                                    type="number"

                                    placeholder="请填写物理分数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="化学" :label-width="formLabelWidth"
                                      prop="chemistry" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.chemistry"
                                    autocomplete="off"
                                    ref="name"
                                    type="number"

                                    placeholder="请填写化学分数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="生物" :label-width="formLabelWidth"
                                      prop="biology" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.biology"
                                    autocomplete="off"
                                    ref="name"
                                    type="number"

                                    placeholder="请填写生物分数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="政治" :label-width="formLabelWidth"
                                      prop="politics" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.politics"
                                    autocomplete="off"
                                    ref="name"
                                    type="number"

                                    placeholder="请填写政治分数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="历史" :label-width="formLabelWidth"
                                      prop="history" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.history"
                                    autocomplete="off"
                                    ref="name"
                                    type="number"

                                    placeholder="请填写历史分数"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="地理" :label-width="formLabelWidth"
                                      prop="geography" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.geography"
                                    autocomplete="off"
                                    ref="name"
                                    type="number"

                                    placeholder="请填写地理分数"
                            ></el-input>
                        </el-form-item>
                        <!-- <el-form-item label="总名次" :label-width="formLabelWidth"
                                      prop="totalRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.totalRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写总名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="班级名次" :label-width="formLabelWidth"
                                      prop="classRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.classRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写班级名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="年级名次" :label-width="formLabelWidth"
                                      prop="gradeRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.gradeRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写年级名次"
                            ></el-input>
                        </el-form-item>
                        
                        <el-form-item label="语文名次" :label-width="formLabelWidth"
                                      prop="chineseRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.chineseRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写语文名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="数学名次" :label-width="formLabelWidth"
                                      prop="mathematicsRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.mathematicsRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写数学名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="英语名次" :label-width="formLabelWidth"
                                      prop="englishRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.englishRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写英语名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="物理名次" :label-width="formLabelWidth"
                                      prop="physicsRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.physicsRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写物理名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="化学名次" :label-width="formLabelWidth"
                                      prop="chemistryRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.chemistryRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写化学名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="生物名次" :label-width="formLabelWidth"
                                      prop="biologyRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.biologyRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写生物名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="政治名次" :label-width="formLabelWidth"
                                      prop="politicsRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.politicsRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写政治名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="历史名次" :label-width="formLabelWidth"
                                      prop="historyRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.historyRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写历史名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="地理名次" :label-width="formLabelWidth"
                                      prop="geographyRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.geographyRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写地理名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="化学赋分" :label-width="formLabelWidth"
                                      prop="chemistryMarks" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.chemistryMarks"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写化学赋分"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="生物赋分" :label-width="formLabelWidth"
                                      prop="biologyMarks" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.biologyMarks"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写生物赋分"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="政治赋分" :label-width="formLabelWidth"
                                      prop="politicsMarks" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.politicsMarks"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写政治赋分"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="地理赋分" :label-width="formLabelWidth"
                                      prop="geographyMarks" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.geographyMarks"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写地理赋分"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="化学赋分名次" :label-width="formLabelWidth"
                                      prop="chemistryMarksRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.chemistryMarksRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写化学赋分名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="生物赋分名次" :label-width="formLabelWidth"
                                      prop="biologyMarksRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.biologyMarksRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写生物赋分名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="政治赋分名次" :label-width="formLabelWidth"
                                      prop="politicsMarksRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.politicsMarksRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写政治赋分名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="地理赋分名次" :label-width="formLabelWidth"
                                      prop="geographyMarksRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.geographyMarksRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写地理赋分名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="理名次" :label-width="formLabelWidth"
                                      prop="scienceRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.scienceRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写理名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="文名次" :label-width="formLabelWidth"
                                      prop="articleRanking" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.articleRanking"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写文名次"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="体育" :label-width="formLabelWidth"
                                      prop="sports" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.sports"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写体育"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="音乐" :label-width="formLabelWidth"
                                      prop="music" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.music"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写音乐"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="信息技术" :label-width="formLabelWidth"
                                      prop="informationTechnology" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.informationTechnology"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写信息技术"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="技术" :label-width="formLabelWidth"
                                      prop="technology" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.technology"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写技术"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="美术" :label-width="formLabelWidth"
                                      prop="arts" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.arts"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写美术"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="理综" :label-width="formLabelWidth"
                                      prop="liZong" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.liZong"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写理综"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="文综" :label-width="formLabelWidth"
                                      prop="wenZong" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.wenZong"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写文综"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="心理" :label-width="formLabelWidth"
                                      prop="psychology" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.psychology"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写心理"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="自习" :label-width="formLabelWidth"
                                      prop="selfStudy" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.selfStudy"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写自习"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="外教" :label-width="formLabelWidth"
                                      prop="foreignTeacher" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.foreignTeacher"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写外教"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="校本选修" :label-width="formLabelWidth"
                                      prop="electiveCourse" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.electiveCourse"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写校本选修"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="课程1" :label-width="formLabelWidth"
                                      prop="courseA" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.courseA"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写课程1"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="课程2" :label-width="formLabelWidth"
                                      prop="courseB" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.courseB"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写课程2"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="课程3" :label-width="formLabelWidth"
                                      prop="courseC" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.courseC"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写课程3"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="课程4" :label-width="formLabelWidth"
                                      prop="courseD" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.courseD"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写课程4"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="排名1" :label-width="formLabelWidth"
                                      prop="rankingA" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.rankingA"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写排名1"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="排名2" :label-width="formLabelWidth"
                                      prop="rankingB" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.rankingB"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写排名2"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="排名3" :label-width="formLabelWidth"
                                      prop="rankingC" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.rankingC"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写排名3"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="排名4" :label-width="formLabelWidth"
                                      prop="rankingD" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.rankingD"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写排名4"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="学期" :label-width="formLabelWidth"
                                      prop="schoolItem">
                            <el-input
                                    v-model="addAchievementForm.schoolItem"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写学期"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="成绩结构" :label-width="formLabelWidth"
                                      prop="achievementStructure">
                            <el-input
                                    v-model="addAchievementForm.achievementStructure"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写成绩结构"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="班级" :label-width="formLabelWidth"
                                      prop="classId" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.classId"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写班级"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="年级" :label-width="formLabelWidth"
                                      prop="gradeId" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.gradeId"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写年级"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="校区" :label-width="formLabelWidth"
                                      prop="campus" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.campus"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写校区"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="" :label-width="formLabelWidth"
                                      prop="createTime" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.createTime"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="" :label-width="formLabelWidth"
                                      prop="isDelete" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.isDelete"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="" :label-width="formLabelWidth"
                                      prop="uuid">
                            <el-input
                                    v-model="addAchievementForm.uuid"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="是否计算排名" :label-width="formLabelWidth"
                                      prop="status" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.status"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写是否计算排名"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="选科类型" :label-width="formLabelWidth"
                                      prop="modeSubject" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.modeSubject"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写选科类型"
                            ></el-input>
                        </el-form-item>
                        <el-form-item label="总分" :label-width="formLabelWidth"
                                      prop="total" v-if="addAchievementForm.id">
                            <el-input
                                    v-model="addAchievementForm.total"
                                    autocomplete="off"
                                    ref="name"
                                    placeholder="请填写总分"
                            ></el-input>
                        </el-form-item> -->
        </el-form>
        <template #footer>
      <span class="dialog-footer">
        <el-button @click="cancel()">取消</el-button>
        <el-button type="primary" @click="save()">保存</el-button>
      </span>
        </template>
    </el-dialog>
</template>

<script>
    import {ref} from "vue";
    import {httpService} from "@/utils/httpService";
    import {ElMessage, ElForm} from "element-plus";
    import {vxRule} from "@/utils/validator";

    export default {
        name: "AddAchievement",
        components: {ElForm, ElMessage},
        data() {
            return {
                dialogFormVisible: ref(false),
                formLabelWidth: "120px",
                title: "",
                personnelType: "",
                addAchievementForm: {
                    name: "",
                    schoolYear: "",
                    typeName: "",
                    clsName: "",
                    studentName: "",
                    studentNumber: "",
                    totalRanking: "",
                    classRanking: "",
                    gradeRanking: "",
                    chinese: "",
                    mathematics: "",
                    english: "",
                    physics: "",
                    chemistry: "",
                    biology: "",
                    politics: "",
                    history: "",
                    geography: "",
                    chineseRanking: "",
                    mathematicsRanking: "",
                    englishRanking: "",
                    physicsRanking: "",
                    chemistryRanking: "",
                    biologyRanking: "",
                    politicsRanking: "",
                    historyRanking: "",
                    geographyRanking: "",
                    chemistryMarks: "",
                    biologyMarks: "",
                    politicsMarks: "",
                    geographyMarks: "",
                    chemistryMarksRanking: "",
                    biologyMarksRanking: "",
                    politicsMarksRanking: "",
                    geographyMarksRanking: "",
                    scienceRanking: "",
                    articleRanking: "",
                    sports: "",
                    music: "",
                    informationTechnology: "",
                    technology: "",
                    arts: "",
                    liZong: "",
                    wenZong: "",
                    psychology: "",
                    selfStudy: "",
                    foreignTeacher: "",
                    electiveCourse: "",
                    courseA: "",
                    courseB: "",
                    courseC: "",
                    courseD: "",
                    rankingA: "",
                    rankingB: "",
                    rankingC: "",
                    rankingD: "",
                    schoolItem: "",
                    achievementStructure: "",
                    classId: "",
                    gradeId: "",
                    campus: "",
                    createTime: "",
                    isDelete: "",
                    uuid: "",
                    status: "",
                    modeSubject: "",
                    total: "",
                },
                // 校验规则
                addAchievementrules: {
                    name: vxRule(true, null, "blur"),
                    schoolYear: vxRule(true, null, "blur"),
                    typeName: vxRule(true, null, "blur"),
                    clsName: vxRule(true, null, "blur"),
                    studentName: vxRule(true, null, "blur"),
                    studentNumber: vxRule(true, null, "blur"),
                    schoolItem: vxRule(true, null, "blur"),
                    achievementStructure: vxRule(true, null, "blur"),
                    uuid: vxRule(true, null, "blur"),
                },
            };
        },
        methods: {
            closeDialog() {
                this.clear();
            },
            cancel() {
                this.dialogFormVisible = false;
                this.clear();
            },
            getbaseAchievementById(id) {
                httpService("/javaApi/baseAchievement/queryById", {id: id}, "get").then(
                    (data) => {
                        this.addAchievementForm = data;
                    }
                );
            },
            clear() {
                this.dialogFormVisible = false;
                //清空form
                    this.addAchievementForm.id = "";
                    this.addAchievementForm.name = "";
                    this.addAchievementForm.schoolYear = "";
                    this.addAchievementForm.typeName = "";
                    this.addAchievementForm.clsName = "";
                    this.addAchievementForm.studentName = "";
                    this.addAchievementForm.studentNumber = "";
                    this.addAchievementForm.totalRanking = "";
                    this.addAchievementForm.classRanking = "";
                    this.addAchievementForm.gradeRanking = "";
                    this.addAchievementForm.chinese = "";
                    this.addAchievementForm.mathematics = "";
                    this.addAchievementForm.english = "";
                    this.addAchievementForm.physics = "";
                    this.addAchievementForm.chemistry = "";
                    this.addAchievementForm.biology = "";
                    this.addAchievementForm.politics = "";
                    this.addAchievementForm.history = "";
                    this.addAchievementForm.geography = "";
                    this.addAchievementForm.chineseRanking = "";
                    this.addAchievementForm.mathematicsRanking = "";
                    this.addAchievementForm.englishRanking = "";
                    this.addAchievementForm.physicsRanking = "";
                    this.addAchievementForm.chemistryRanking = "";
                    this.addAchievementForm.biologyRanking = "";
                    this.addAchievementForm.politicsRanking = "";
                    this.addAchievementForm.historyRanking = "";
                    this.addAchievementForm.geographyRanking = "";
                    this.addAchievementForm.chemistryMarks = "";
                    this.addAchievementForm.biologyMarks = "";
                    this.addAchievementForm.politicsMarks = "";
                    this.addAchievementForm.geographyMarks = "";
                    this.addAchievementForm.chemistryMarksRanking = "";
                    this.addAchievementForm.biologyMarksRanking = "";
                    this.addAchievementForm.politicsMarksRanking = "";
                    this.addAchievementForm.geographyMarksRanking = "";
                    this.addAchievementForm.scienceRanking = "";
                    this.addAchievementForm.articleRanking = "";
                    this.addAchievementForm.sports = "";
                    this.addAchievementForm.music = "";
                    this.addAchievementForm.informationTechnology = "";
                    this.addAchievementForm.technology = "";
                    this.addAchievementForm.arts = "";
                    this.addAchievementForm.liZong = "";
                    this.addAchievementForm.wenZong = "";
                    this.addAchievementForm.psychology = "";
                    this.addAchievementForm.selfStudy = "";
                    this.addAchievementForm.foreignTeacher = "";
                    this.addAchievementForm.electiveCourse = "";
                    this.addAchievementForm.courseA = "";
                    this.addAchievementForm.courseB = "";
                    this.addAchievementForm.courseC = "";
                    this.addAchievementForm.courseD = "";
                    this.addAchievementForm.rankingA = "";
                    this.addAchievementForm.rankingB = "";
                    this.addAchievementForm.rankingC = "";
                    this.addAchievementForm.rankingD = "";
                    this.addAchievementForm.schoolItem = "";
                    this.addAchievementForm.achievementStructure = "";
                    this.addAchievementForm.classId = "";
                    this.addAchievementForm.gradeId = "";
                    this.addAchievementForm.campus = "";
                    this.addAchievementForm.createTime = "";
                    this.addAchievementForm.isDelete = "";
                    this.addAchievementForm.uuid = "";
                    this.addAchievementForm.status = "";
                    this.addAchievementForm.modeSubject = "";
                    this.addAchievementForm.total = "";
            },
            save() {
                this.$refs.addAchievementRef.validate((valid) => {
                    if (valid) {
                        let params = new FormData(); //创建一个form对象,必须是form对象否则后端接受不到数据
                        // params.append("name", this.addAchievementForm.name);
                        // params.append("schoolYear", this.addAchievementForm.schoolYear);
                        // params.append("typeName", this.addAchievementForm.typeName);
                        // params.append("clsName", this.addAchievementForm.clsName);
                        // params.append("studentName", this.addAchievementForm.studentName);
                        // params.append("studentNumber", this.addAchievementForm.studentNumber);
                        // params.append("totalRanking", this.addAchievementForm.totalRanking);
                        // params.append("classRanking", this.addAchievementForm.classRanking);
                        // params.append("gradeRanking", this.addAchievementForm.gradeRanking);
                        params.append("chinese", this.addAchievementForm.chinese);
                        params.append("mathematics", this.addAchievementForm.mathematics);
                        params.append("english", this.addAchievementForm.english);
                        params.append("physics", this.addAchievementForm.physics);
                        params.append("chemistry", this.addAchievementForm.chemistry);
                        params.append("biology", this.addAchievementForm.biology);
                        params.append("politics", this.addAchievementForm.politics);
                        params.append("history", this.addAchievementForm.history);
                        params.append("geography", this.addAchievementForm.geography);
                        // params.append("chineseRanking", this.addAchievementForm.chineseRanking);
                        // params.append("mathematicsRanking", this.addAchievementForm.mathematicsRanking);
                        // params.append("englishRanking", this.addAchievementForm.englishRanking);
                        // params.append("physicsRanking", this.addAchievementForm.physicsRanking);
                        // params.append("chemistryRanking", this.addAchievementForm.chemistryRanking);
                        // params.append("biologyRanking", this.addAchievementForm.biologyRanking);
                        // params.append("politicsRanking", this.addAchievementForm.politicsRanking);
                        // params.append("historyRanking", this.addAchievementForm.historyRanking);
                        // params.append("geographyRanking", this.addAchievementForm.geographyRanking);
                        // params.append("chemistryMarks", this.addAchievementForm.chemistryMarks);
                        // params.append("biologyMarks", this.addAchievementForm.biologyMarks);
                        // params.append("politicsMarks", this.addAchievementForm.politicsMarks);
                        // params.append("geographyMarks", this.addAchievementForm.geographyMarks);
                        // params.append("chemistryMarksRanking", this.addAchievementForm.chemistryMarksRanking);
                        // params.append("biologyMarksRanking", this.addAchievementForm.biologyMarksRanking);
                        // params.append("politicsMarksRanking", this.addAchievementForm.politicsMarksRanking);
                        // params.append("geographyMarksRanking", this.addAchievementForm.geographyMarksRanking);
                        // params.append("scienceRanking", this.addAchievementForm.scienceRanking);
                        // params.append("articleRanking", this.addAchievementForm.articleRanking);
                        // params.append("sports", this.addAchievementForm.sports);
                        // params.append("music", this.addAchievementForm.music);
                        // params.append("informationTechnology", this.addAchievementForm.informationTechnology);
                        // params.append("technology", this.addAchievementForm.technology);
                        // params.append("arts", this.addAchievementForm.arts);
                        // params.append("liZong", this.addAchievementForm.liZong);
                        // params.append("wenZong", this.addAchievementForm.wenZong);
                        // params.append("psychology", this.addAchievementForm.psychology);
                        // params.append("selfStudy", this.addAchievementForm.selfStudy);
                        // params.append("foreignTeacher", this.addAchievementForm.foreignTeacher);
                        // params.append("electiveCourse", this.addAchievementForm.electiveCourse);
                        // params.append("courseA", this.addAchievementForm.courseA);
                        // params.append("courseB", this.addAchievementForm.courseB);
                        // params.append("courseC", this.addAchievementForm.courseC);
                        // params.append("courseD", this.addAchievementForm.courseD);
                        // params.append("rankingA", this.addAchievementForm.rankingA);
                        // params.append("rankingB", this.addAchievementForm.rankingB);
                        // params.append("rankingC", this.addAchievementForm.rankingC);
                        // params.append("rankingD", this.addAchievementForm.rankingD);
                        // params.append("schoolItem", this.addAchievementForm.schoolItem);
                        // params.append("achievementStructure", this.addAchievementForm.achievementStructure);
                        // params.append("classId", this.addAchievementForm.classId);
                        // params.append("gradeId", this.addAchievementForm.gradeId);
                        // params.append("campus", this.addAchievementForm.campus);
                        // params.append("createTime", this.addAchievementForm.createTime);
                        // params.append("isDelete", this.addAchievementForm.isDelete);
                        // params.append("uuid", this.addAchievementForm.uuid);
                        // params.append("status", this.addAchievementForm.status);
                        // params.append("modeSubject", this.addAchievementForm.modeSubject);
                        // params.append("total", this.addAchievementForm.total);
                        if (this.addAchievementForm.id) {
                            params.append("id", this.addAchievementForm.id);
                            httpService("/javaApi/baseAchievement/edit", params, "post").then(
                                (data) => {
                                    if (data.code == 200) {
                                        ElMessage.success("修改成功");
                                        this.clear();
                                        //刷新父组件的数据
                                        this.$parent.getbaseAchievementList();
                                    } else {
                                        ElMessage.error("修改失败");
                                    }
                                }
                            );
                        } else {
                            httpService("/javaApi/baseAchievement/add", params, "post").then(
                                (data) => {
                                    if (data.code == 200) {
                                        ElMessage.success("添加成功");
                                        this.clear();
                                        //刷新父组件的数据
                                        this.$parent.getbaseAchievementList();
                                    } else {
                                        ElMessage.error("添加失败");
                                    }
                                }
                            );
                        }
                    } else {
                        return false;
                    }
                });
            },
        },
    };
</script>
<style>
</style>